﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/MasterPages/SubMaster.Master" AutoEventWireup="true" CodeBehind="ViewFiles.aspx.cs" Inherits="ArchivingDataWebForms.Pages.Files.ViewFiles" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="AdvancedRadGridResults">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="AdvancedRadGridResults"/>
                    <telerik:AjaxUpdatedControl ControlID="iframeBarcode"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <div style="padding:20px;">

            <telerik:RadButton ID="RadButtonSilverLightEnd" runat="server" Text="RadButton" OnClick="RadButtonSilverLightEnd_Click" Style="display: none;"></telerik:RadButton>

         <telerikHelper:AdvancedRadGrid ID="AdvancedRadGridResults" runat="server" SkinID="AdvancedRadGridArDefault" CellSpacing="0" GridLines="None" AutoGenerateColumns="False" ShowGroupPanel="True"
                                    OnNeedDataSource="AdvancedRadGridResults_NeedDataSource" OnItemCommand="AdvancedRadGridResults_ItemCommand" OnInsertCommand="AdvancedRadGridResults_InsertCommand" 
                                    OnItemDataBound="AdvancedRadGridResults_ItemDataBound" OnUpdateCommand="AdvancedRadGridResults_UpdateCommand" OnDeleteCommand="AdvancedRadGridResults_DeleteCommand" OnItemCreated="AdvancedRadGridResults_ItemCreated">
                    <MasterTableView DataKeyNames="File_ID">
                        <Columns>
                            <telerik:GridBoundColumn DataField="File_ID" DataType="System.Int64" UniqueName="File_ID" HeaderText="الرقم" Display="False" ReadOnly="true" AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="File_code" DataType="System.String" UniqueName="File_code" HeaderText="الترميز" Display="true" EditFormColumnIndex="0" AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FileTitle_Ar" DataType="System.String" UniqueName="FileTitle_Ar" HeaderText="العنوان" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FileSubject_Ar" DataType="System.String" UniqueName="FileSubject_Ar" HeaderText="الموضوع" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridDateTimeColumn DataField="FromDate" DataType="System.DateTime" UniqueName="FromDate" HeaderText="من" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true" AllowFiltering="false">
                            </telerik:GridDateTimeColumn>
                            <telerik:GridDateTimeColumn DataField="ToDate" DataType="System.DateTime" UniqueName="ToDate" HeaderText="الي" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true" AllowFiltering="false">
                                <HeaderStyle Width="10px"/>
                            </telerik:GridDateTimeColumn>
                            <telerik:GridCheckBoxColumn DataField="IS_Secret" DataType="System.Boolean" UniqueName="IS_Secret" HeaderText="سري" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true" AllowFiltering="false">
                                <HeaderStyle Width="30px"/>
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridTemplateColumn HeaderText="الترتيب" AllowFiltering="false">
                                <ItemTemplate>
                                    <ul class="UlLayout" style="width:80px;">
                                        <li class="normalFlow">
                                            <asp:Button ID="ButtonUp" Text='^' runat="server" CommandName="ButtonUp" CommandArgument='<%# Eval("File_ID") %>'></asp:Button>
                                        </li>
                                        <li class="normalFlow" style="padding-right:10px;">
                                            <asp:Button ID="ButtonDown" Text=" v " runat="server" CausesValidation="False" CommandName="ButtonDown" CommandArgument='<%# Eval("File_ID") %>' />
                                        </li>
                                    </ul>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Barcode" AllowFiltering="false">
                                <ItemTemplate>
                                    <ul class="UlLayout">
                                        <li>
                                            <asp:ImageButton ID="ButtonBarcode" Text='^' runat="server" CommandName="ButtonBarcode" CommandArgument='<%# Eval("File_ID") %>' ImageUrl="~/Images/barcode.png" Width="32" Height="32"></asp:ImageButton>
                                        </li>
                                    </ul>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="الماسح الضوئي" AllowFiltering="false">
                                <ItemTemplate>
                                    <ul class="UlLayout">
                                        <li>
                                            <asp:ImageButton ID="ButtonScanner" Text='^' runat="server" CommandName="ButtonScanner" CommandArgument='<%# Eval("File_ID") %>' ImageUrl="~/Images/Scanner.png" Width="32" Height="32"></asp:ImageButton>
                                        </li>
                                    </ul>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="رفع" AllowFiltering="false" ItemStyle-Width="100">
                                <ItemTemplate>
                                    <ul class="UlLayout" style="width:100px;">
                                        <li class="floatRight" style="width:70px;">
                                             <telerik:RadAsyncUpload ID="RadAsyncUploadatt" runat="server" Width="20px" InputSize="3" HideFileInput="true"></telerik:RadAsyncUpload>
                                        </li>
                                        <li class="floatRight"  style="width:30px;">
                                             <asp:ImageButton ID="ButtonUpload" Text='^' runat="server" CommandName="ButtonUpload" CommandArgument='<%# Eval("File_ID") %>' ImageUrl="~/Images/Up.png" Width="25" Height="25"></asp:ImageButton>
                                       </li>
                                        <li class="clear"></li>
                                    </ul>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="FileNote_Ar" DataType="System.String" UniqueName="FileNote_Ar" HeaderText="الملاحظات" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>

                            <telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="ImageButton" CancelText="الغاء" EditText="تحرير" UpdateText="حفظ">
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="40px" ConfirmDialogType="RadWindow" ConfirmText="هل انت متاكد من عملية الحذف ؟" ConfirmTitle="حذف" Text="حذف">
                            </telerik:GridButtonColumn>
                            <telerik:GridRowIndicatorColumn Resizable="True" Visible="true">
                            </telerik:GridRowIndicatorColumn>
                        </Columns>
                        <NestedViewSettings>
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="File_ID" MasterKeyField="File_ID"></telerik:GridRelationFields>
                            </ParentTableRelation>
                        </NestedViewSettings>
                        <NestedViewTemplate>
                            <iframe id="Iframe" src='<%#"AddFile.aspx?File_ID="+Eval("File_ID") %>' width="100%" height="500px" ></iframe>
<%--                            <telerik:RadWindow ID="Attachments_CustomFields" runat="server" NavigateUrl="~/Files/AddFile.aspx?File_ID=" Width="300px" Height="300px"> </telerik:RadWindow>--%>
                        </NestedViewTemplate>


                    <%--   <EditFormSettings>
                    <FormTemplate>
                    <ul class="UlLayout" style="margin-right:20px;">
                    <li class="paddingTop">الترميز</li>
                    <li>
                    <telerik:RadTextBox ID="RadTextBoxPCode" runat="server" SkinID="RadTextBoxHalf" Text='<%# Bind("File_code") %>'></telerik:RadTextBox>
                    </li>
                    <li class="paddingTop"></li>
                    <li>
                    <telerik:RadTextBox ID="RadTextBoxPName" runat="server" Text='<%# Bind("FileName_Ar") %>'></telerik:RadTextBox>
                    </li>
                    <li class="paddingTop">القيمة</li>
                    <li>
                    <telerik:RadTextBox ID="RadTextBoxValue" runat="server" Text='<%# Bind("FileValue_Ar") %>'></telerik:RadTextBox>
                    </li>
                    <li class="paddingTop">الملاحظات</li>
                    <li>
                    <telerik:RadTextBox ID="RadTextBoxPNote" runat="server" TextMode="MultiLine" Rows="5" Text='<%# Bind("FileNote_Ar") %>'></telerik:RadTextBox>
                    </li>
                    <li class="paddingTop">
                    <div>
                    <asp:Button ID="ButtonUpdate" Text='حفظ' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button>
                    <asp:Button ID="ButtonCancel" Text="الغاء" runat="server" CausesValidation="False" CommandName="Cancel" />
                    </div>
                    </li>
                    </ul>
                    </FormTemplate>
                    </EditFormSettings>--%>
                    </MasterTableView>
                </telerikHelper:AdvancedRadGrid>
    </div>
            <iframe id="iframeBarcode" runat="server" src =""  style="display:none;"></iframe>
</asp:Content>
